package com.xt.Demo;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Movie[] movies = new Movie[4];
        movies[0] = new Movie(11, "水门桥1", 38.91, 9.81, "许可1", "武警1", "12万人想看1");
        movies[1] = new Movie(12, "水门桥2", 38.92, 9.82, "许可2", "武警2", "12万人想看2");
        movies[2] = new Movie(13, "水门桥3", 38.93, 9.83, "许可3", "武警3", "13万人想看3");
        movies[3] = new Movie(14, "水门桥4", 48.94, 9.84, "许可4", "武警4", "14万人想看4");

        MovieOperator operator = new MovieOperator(movies);
        operator.printAllMovies();
        operator.searchMoviesById(3);
        Scanner scanner = new Scanner(System.in);
        while (true) {
            System.out.println("=电影信息系统=");
            System.out.println("1, 查询全部电影信息");
            System.out.println("2, 根据Id查询某个电影的详细信息");
            int id = scanner.nextInt();
            switch (id) {
                case 1:
                     int movieId = scanner.nextInt();
                    operator.searchMoviesById(movieId);
                    break;
                case 2:
                    operator.printAllMovies();
                    break;
                default:
                    System.out.println("您输入的命令有问题");
            }
        }
    }
}
